home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / machserver / 1.098 / Include / lfsFileLayout.h < prev    next >
C/C++ Source or Header  |  1990-10-19  |  3KB  |  87 lines

  1. /*
  2.  * lfsFileLayout.h --
  3.  *
  4.  *    Declarations of data structures describing the layout of 
  5.  *    files and descriptors in LFS segments.
  6.  *
  7.  * Copyright 1989 Regents of the University of California
  8.  * Permission to use, copy, modify, and distribute this
  9.  * software and its documentation for any purpose and without
  10.  * fee is hereby granted, provided that the above copyright
  11.  * notice appear in all copies.  The University of California
  12.  * makes no representations about the suitability of this
  13.  * software for any purpose.  It is provided "as is" without
  14.  * express or implied warranty.
  15.  *
  16.  * $Header: /sprite/src/kernel/lfs/RCS/lfsFileLayout.h,v 1.3 90/10/19 17:22:48 mendel Exp $ SPRITE (Berkeley)
  17.  */
  18.  
  19. #ifndef _LFSFILELAYOUT
  20. #define _LFSFILELAYOUT
  21.  
  22. /*
  23.  * LfsFileLayoutSummary defines the format of file layout summary bytes.
  24.  * The LfsFileLayoutSummary maybe followed by zero or more bytes of
  25.  * summary info describing the 
  26.  */
  27.  
  28. typedef struct LfsFileLayoutSummary {
  29.     unsigned short    blockType;     /* Type of data block. See below. */
  30.     unsigned short    numBlocks;     /* Number of file system blocks covered
  31.                     * by this summary. */
  32.     int    fileNumber;                 /* File number of block(s) owner. */
  33.     unsigned short     truncVersion;  /* Truncate version number used for
  34.                     * cleaning files. */
  35.     unsigned short      numDataBlocks; /* Number of file block ranges after 
  36.                         * this structure. */
  37.     /*
  38.      * LfsFileLayoutSummary is followed by numDataBlocks logical block
  39.      * numbers.
  40.      */
  41. } LfsFileLayoutSummary;
  42. /*
  43.  * LfsFileLayoutLog describes the format of directory log in the summary
  44.  * region. 
  45.  */
  46.  
  47. typedef struct LfsFileLayoutLog {
  48.     unsigned short    blockType;     /* Type of data block. See below. */
  49.     unsigned short    numBlocks;     /* Number of file system blocks covered
  50.                     * by this summary. */
  51.     unsigned short    numDataBlocks;     
  52.                       /* Number of data blocks covered
  53.                        * by this summary. */
  54.     unsigned short     reserved;
  55. } LfsFileLayoutLog;
  56.  
  57. /*
  58.  * LfsFileLayoutDesc describes the format of summary record for 
  59.  * descriptor blocks. */
  60. typedef struct LfsFileLayoutDesc {
  61.     unsigned short    blockType;     /* Type of data block. See below. */
  62.     unsigned short    numBlocks;    /* Number of file system blocks covered
  63.                        * by this summary. */
  64. } LfsFileLayoutDesc;
  65.  
  66. /*
  67.  * Valid blockType fields.
  68.  */
  69. #define    LFS_FILE_LAYOUT_DESC         0x0   /* File descriptor block. */
  70. #define    LFS_FILE_LAYOUT_DATA         0x1   /* File data block. */
  71. #define    LFS_FILE_LAYOUT_INDIRECT     0x2   /* File indirect block. */
  72. #define    LFS_FILE_LAYOUT_DBL_INDIRECT 0x3   /* File double indirect block. */
  73. #define    LFS_FILE_LAYOUT_DIR_LOG         0x4   /* Directory log data. */
  74.  
  75.  
  76. #define    LFS_FILE_LAYOUT_PARAMS_SIZE 32
  77. typedef struct LfsFileLayoutParams {
  78.     int     descPerBlock;    /* Number of file descriptors to pack together per
  79.              * block.  */
  80.     char pad[LFS_FILE_LAYOUT_PARAMS_SIZE - 4];
  81.  
  82. } LfsFileLayoutParams;
  83.  
  84.  
  85. #endif /* _LFSFILELAYOUT */
  86.  
  87.